<template>
  <a-result title="你还没有创建可视化看板，赶快创建一个吧!" style="padding-top: 200px">
    <template #icon>
      <smile-twoTone />
    </template>
    <template #extra>
      <a-button type="primary" @click="addKanban()">立即创建</a-button>
    </template>
  </a-result>
</template>
<script lang="ts">
  import { SmileTwoTone } from '@ant-design/icons-vue';
  import { defineComponent } from 'vue';
  import { useStore } from 'vuex';

  export default defineComponent({
    components: {
      SmileTwoTone,
    },
    setup(props) {
      const store = useStore();
      return {
        addKanban: () => {
          if (store.state.user.userInfo) {
            store.commit('common/setParams', { addKanbanVisible: true });
          } else {
            store.commit('common/setParams', { loginDisplay: true });
          }
        },
      };
    },
  });
</script>
